package edu.ntu.cloudroid.model.function.stats;

import java.util.List;

import edu.ntu.cloudroid.model.data.AbstractData;

public class MaxFunction implements IDataStats{

	@Override
	public Object getStats(List<AbstractData> data, Object params) {
		//param here is the column id
		int colIdx = ((Integer)params).intValue();
		AbstractData max = data.get(0);
		for (AbstractData ad : data)
			if (ad.compareTo(max, colIdx)==1)
				max = ad;
		return max;
	}

}
